from pydantic import BaseModel, Field
from typing import Optional, List


class Poetry(BaseModel):
    id: int


class PoetryCreate(BaseModel):
    title: str = Field(example="名称")
    rhythmic: Optional[str] = Field('', example="词牌名")
    categoryCode: str = Field(example="类别编码")
    author: Optional[str] = Field('', example="作者")
    chapter: Optional[str] = Field('', example='')
    section: Optional[str] = Field('', example='')
    desc: Optional[str] = Field('', example='')
    paragraphs: List[str] = Field([], example=['滚滚长江东逝水'])
    notes: Optional[List[str]] = Field([], example=['滚滚长江东逝水'])


class PoetryUpdate(BaseModel):
    id: int
    title: str = Field(example="名称")
    rhythmic: Optional[str] = Field('', example="词牌名")
    categoryCode: str = Field(example="类别编码")
    author: Optional[str] = Field('', example="作者")
    chapter: Optional[str] = Field('', example='')
    section: Optional[str] = Field('', example='')
    desc: Optional[str] = Field('', example='')
    paragraphs: List[str] = Field([], example=['滚滚长江东逝水'])
    notes: Optional[List[str]] = Field([], example=['滚滚长江东逝水'])
